import { http } from '@/utils/http'
//isDraft true为草稿，false不是草稿
export const submitArticles = (data, isDraft) => {
  return async () => {
    http.post(`/mp/articles?draft=${isDraft}`, data)
  }
}

export const getContent = (id) => {
  return async () => {
    const res = await http.get(`/mp/articles/${id}`)
    return res.data.data
  }
}

export const editContent = (id, data, isDraft) => {
  return async () => {
    http.put(`/mp/articles/${id}?draft=${isDraft}`, data)
  }
}
